    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// demo接口1
export const demo1 = (data:any) => {
    return service({
        url: '/user/user/demo1/' + data,
        method: 'post'
    })
};


// demo接口2
export const demo2 = (data:any) => {
    return service({
        url: '/user/user/demo2',
        method: 'post',
        data
    })
};

// 登录
export const login = (data:any) => {
    return service({
        url: '/auth/index/login',
        method: 'post',
        data
    })
};

// 获取用户权限菜单
export const getMenuList = () => {
    return service({
        url: '/auth/index/getMenuList',
        method: 'post'
    })
};

// 获取商户条件分页列表
export const getUserPage = (data:any) => {
    return service({
        url: '/auth/index/getUserPage',
        method: 'post',
        data
    })
};

// 修改商户信息
export const updateUser = (data:any) => {
    return service({
        url: '/auth/index/updateUser',
        method: 'post',
        data
    })
};

// 根据iD删除单个商户
export const deleteByUserId = (id:any) => {
    return service({
        url: '/auth/index/deleteByUserId/' + id,
        method: 'post'
    })
};

// 批量删除商户
export const deleteBatch = (data:any) => {
    return service({
        url: '/auth/index/deleteBatch',
        method: 'post',
        data
    })
};

// 审核商户
export const checkUser = (data:any) => {
    return service({
        url: '/auth/index/checkUser',
        method: 'post',
        data
    })
};

// 品牌条件分页列表
export const getBrandPage = (data:any) => {
    return service({
        url: '/prod/index/getBrandPage',
        method: 'post',
        data
    })
};

// 新增品牌
export const addBrand = (data:any) => {
    return service({
        url: '/prod/index/addBrand',
        method: 'post',
        data
    })
};

// 修改品牌状态
export const updateBrandStatus = (data:any) => {
    return service({
        url: '/prod/index/updateBrandStatus',
        method: 'post',
        data
    })
};

// 获取树形分类列表
export const getTypeTreeList = () => {
    return service({
        url: '/prod/type/getTypeTreeList',
        method: 'post'
    })
};

// 获取树形分类列表
export const showAndHide = (data:any) => {
    return service({
        url: '/prod/type/showAndHide',
        method: 'post',
        data
    })
};

// 根据iD删除类型
export const deleteByTypeId = (id:any) => {
    return service({
        url: '/prod/type/deleteByTypeId/' + id,
        method: 'delete'
    })
};

// 新增商品类型
export const addType = (data:any) => {
    return service({
        url: '/prod/type/addType',
        method: 'post',
        data
    })
};

// 修改商品类型信息
export const updateType = (data:any) => {
    return service({
        url: '/prod/type/updateType',
        method: 'post',
        data
    })
};

// 商品分页列表
export const getProdList = (data:any) => {
    return service({
        url: '/prod/shop/getProdList',
        method: 'post',
        data
    })
};

// 新增商品
export const addProd = (data:any) => {
    return service({
        url: '/prod/shop/addProd',
        method: 'post',
        data
    })
};

// 获取树形分类列表选择下拉框
export const getTypeSelectTree = () => {
    return service({
        url: '/prod/type/getTypeSelectTree',
        method: 'post'
    })
};

// 获取品牌列表下拉框
export const getBrandList = () => {
    return service({
        url: '/prod/brand/getBrandList',
        method: 'post'
    })
};

// 获取单位列表下拉框
export const getUnitList = () => {
    return service({
        url: '/prod/unit/getUnitList',
        method: 'post'
    })
};

// 获取标签列表下拉框
export const getTagList = () => {
    return service({
        url: '/prod/tag/getTagList',
        method: 'post'
    })
};

// 获取供应商列表下拉框
export const getApprList = () => {
    return service({
        url: '/prod/appr/getApprList',
        method: 'post'
    })
};

// 批量删除商品
export const deleteBatchProd = (data:any) => {
    return service({
        url: '/prod/shop/deleteBatchProd',
        method: 'post',
        data
    })
};